package com.coderman.infosys.auth.infrast.dao.mapper;

import com.coderman.infosys.plat.auth.common.page.PageBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import com.coderman.infosys.auth.infrast.dao.dataobject.AuthorityDO;


/**
* @Description:抽象权限表接口
* @Author:
* @CreateTime:2022-01-02 15:27:39
* @version v1.0
*/
@Mapper
public interface AuthorityMapper{

	/**
	 *
	 * @Description 保存数据记录
	 * @param authorityDO
	 * @return long
	 */
	long insert(@Param(value = "authorityDO") AuthorityDO authorityDO);

	/**
	 *
	 * @Description 更新数据记录
	 * @param authorityDO
	 * @return int
	 */
	int update(@Param(value = "authorityDO") AuthorityDO authorityDO);

	/**
	 *
	 * @Description 获取所有数据记录
	 * @return List<AuthorityDO>
	 */
	List<AuthorityDO> getAll();

	/**
	 *
	 * @Description 根据ID获取单条记录
	 * @param id
	 * @return AuthorityDO
	 */
	AuthorityDO getById(@Param(value = "id") Long id);

	/**
	 *
	 * @Description 根据ID删除单条记录
	 * @param id
	 * @return int
	 */
	int deleteById(@Param(value = "id") Long id);

	/**
	 *
	 * @Description 查询
	 * @return List<AuthorityDO>
	 */
	AuthorityDO getByCode(@Param(value = "authorityCode") String authorityCode);

	/**
	 *
	 * @Description 查询
	 * @return List<AuthorityDO>
	 */
	AuthorityDO getByRoleCode(@Param(value = "roleCode") String roleCode);

	/**
	 *
	 * @Description 查询
	 * @return List<AuthorityDO>
	 */
	AuthorityDO getByRoleGroupCode(@Param(value = "roleGroupCode") String roleGroupCode);


	/**
	 * 分页查询
	 * @param pageBO
	 * @return
	 */
	List<AuthorityDO> getPageList(@Param(value = "pageBO") PageBO pageBO);

	/**
	 * 分页查询总条数
	 * @param pageBO
	 * @return
	 */
	Integer getTotalCount(@Param(value = "pageBO") PageBO pageBO);

}